//
//  MVVMBaseTabBarController.swift
//  test-ios
//
//  Created by wyz5204 on 2023/6/7.
//

import Foundation
import UIKit


class MVVMBaseTabBarController<T : MVVMBaseViewModel> : UITabBarController {
    
    var viewModel : T
    let navigator : MVVMNavigator = MVVMNavigator.shared
    
    init(viewModel: T) {
        self.viewModel = viewModel
        super.init(nibName: nil, bundle: nil)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        print("MVVMBaseTabBarController  >>> \(viewModel)")
        initView(self.view)
        print("MVVMBaseTabBarController  >>> ")
        bindViewModel(viewModel)
    }
    
    public override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        updateView()
    }
    
    func initView(_ contentView : UIView) {
        
    }
    
    func bindViewModel(_ viewModel : T){
        
    }
    
    func updateView(){
        
    }
}
